<?php
/* @var $this CustomerController */
/* @var $model Customer */

$this->breadcrumbs=array(
	'Customers'=>array('index'),
	'Manage',
);

$this->menu=array(
	array('label'=>'List Customer', 'url'=>array('index')),
	array('label'=>'Create Customer', 'url'=>array('create')),
);


?>

<?php
$cs = Yii::app ()->clientScript;
$cs->registerScript('#yw2',
"
		$(document).ready(function(){
 		   $('#main-nav .nav-top-item').eq(0).removeClass('current');
		   $('#yw1').css(\"display\",\"none\");
		   $('#yw2').css(\"display\",\"block\");
		   $('#main-nav .nav-top-item').eq(1).addClass('current');
		});
"
);
?>

    <div class="content-box">
      <!-- Start Content Box -->
      <div class="content-box-header">
        <h3>管理客户分组</h3>
        <ul class="content-box-tabs">
          <li><a href="<?php echo $this->createUrl('/backend/customer')?>" class="default-tab current">客户列表</a></li>
          <li><a href="<?php echo $this->createUrl('/backend/addcustomer')?>">增加客户</a></li>
        </ul>
        <div class="clear"></div>
      </div>
      <!-- End .content-box-header -->
      <div class="content-box-content">
        <div class="tab-content default-tab" id="tab1">   
			<?php $this->widget('zii.widgets.grid.CGridView', array(
				'id'=>'customer-grid',
				'dataProvider'=>$model->search(),
				'filter'=>$model,
				'columns'=>array(
					array(
						'name'=>'display_name',
						'htmlOptions'=>array(
						'style'=>'text-align:center; font-size:14px; vertical-align:middle',
						),
					),
					array(
						'name'=>'customer_login',
						'htmlOptions'=>array(
								'style'=>'text-align:center; font-size:14px; vertical-align:middle',
						),
					),
					array(
						'name'=>'customer_email',
						'htmlOptions'=>array(
								'style'=>'text-align:center; font-size:14px; vertical-align:middle',
						),
					),
					array(
							'name'=>'customer_group',
							'value' => 'Customergroup::model()->findCustomerGroupName($data->customer_group)',
							'htmlOptions'=>array(
									'style'=>'text-align:center; font-size:14px; vertical-align:middle',
							),
					),
					array(
							'name'=>'customer_status',
							'value' => 'Customer::model()->CustomerStatus($data->customer_status)',
							'htmlOptions'=>array(
									'style'=>'text-align:center; font-size:14px; vertical-align:middle',
							),
					),
					array(
							'name'=>'customer_registered',
							'htmlOptions'=>array(
									'style'=>'text-align:center; font-size:14px; vertical-align:middle',
							),
					),
					array(
						'header'=>'操作',
						'class'=>'CButtonColumn',
						'template'=>'{update} {delete}',
						'htmlOptions'=>array(
								'style'=>'text-align:center;  vertical-align:middle',
						),
						'buttons' => array(
								'update'=>array(
										'label'=>'更新',
										'url'=>'array("/backend/updatecustomer/$data->ID")',
								),
								'delete'=>array(
										'label'=>'删除',
										'url'=>'array("/backend/delcustomer/$data->ID")',
								),
						),
					),
				),
			)); ?>
 		</div>
        <!-- End #tab1 -->
        <div class="tab-content" id="tab2">         
            <fieldset>
		
            </fieldset>
            <div class="clear"></div>
            <!-- End .clear -->          
        </div>
        <!-- End #tab2 -->
      </div>
      <!-- End .content-box-content -->
    </div>
    <!-- End .content-box -->
